home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
DELPHI32
/
GRAPHICS
/
TS32
/
HIRESTIM.INT
< prev
next >
Wrap
Text File
|
1996-03-21
|
1KB
|
46 lines
unit HiResTimer;
interface
uses
Windows, MMSystem, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
THiResTimer = class;
EHiResTimer = class( Exception );
TTimerThread = class( TThread )
private
protected
public
hr: THiResTimer;
procedure Execute; override;
end;
THiResTimer = class( TComponent )
private
nID: UINT;
FEnabled: boolean;
FInterval: UINT;
FResolution: UINT;
FOnTimer: TNotifyEvent;
hTimerEvent: THandle;
bPaused: boolean;
timerThread: TTimerThread;
procedure CreateTimer;
protected
procedure SetEnabled( b: boolean );
public
constructor Create( AOwner: TComponent ); override;
destructor Destroy; override;
procedure Pause;
procedure Resume;
published
property Enabled: boolean read FEnabled write SetEnabled default FALSE;
property Interval: UINT read FInterval write FInterval default 100;
property Resolution: UINT read FResolution write FResolution default 100;
property OnTimer: TNotifyEvent read FOnTimer write FOnTimer;
end;
procedure Register;